import faker from 'faker';
import { Mappable } from './CustomMap';

export class Company implements Mappable {
  name: string;
  //标语
  catchPhrase: string;
  location: {
    lat: number;
    lng: number;
  };
  color: string;

  constructor() {
    this.name = faker.company.companyName();
    this.catchPhrase = faker.company.catchPhrase();
    this.location = {
      lat: parseFloat(faker.address.latitude()),
      lng: parseFloat(faker.address.longitude())
    };
  }

  //返回信息窗口的文本内容方法
  markerContent(): string {
    return `
    <p>公司名： ${this.name}</p>
    <p>公司标语： ${this.catchPhrase}</p>
    `;
  }
}
